package com.cehome.cloudbox.enums;
/**
 * 流程实例状态
 *
 */
public enum ProcIncStateEnum {

    /**
     * 说明
     */
    RUNNING("1", "流程进行中"),
    FINISH("2", "流程结束（正常）"),
    TERMINATION("3", "流程结束（手动终止）"),
    SUSPENDED("90", "流程已挂起"),
    CANCEL("99", "流程已取消");

    /**
     * 状态
     */
    private final String state;

    /**
     * 说明
     */
    private final String remark;

    ProcIncStateEnum(String type, String remark) {
        this.state = type;
        this.remark = remark;
    }

    /**
     * 通过状态获取说明
     *
     * @param state 状态
     * @return 说明
     */
    public static String getRemarkByState(String state) {
        for (ProcIncStateEnum stateEnum : ProcIncStateEnum.values()) {
            if (stateEnum.getState().equals(state)) {
                return stateEnum.getRemark();
            }
        }
        return null;
    }

    public String getState() {
        return state;
    }

    public String getRemark() {
        return remark;
    }
}
